import { createRouter as _createRouter, createWebHistory } from "vue-router";

import register from '../views/register.vue'
import login from '../views/login.vue'

import home from '../views/home.vue'
import call from '../views/call.vue'
import my from '../views/my.vue'
import vip from '../views/vip.vue'
import wallet from "../views/wallet.vue";
import PointsMall from "../views/PointsMall.vue";
import RoomList from "../views/RoomList.vue";
import ReserveRoom from "../views/ReserveRoom.vue";
import findpwd from "../views/findpwd.vue";
import mylog from "../views/mylog.vue";
import cashBack from "../views/cashBack.vue";
import cashBackLog from "../views/cashBackLog.vue";
import question from "../views/question.vue";
import userInfo from "../views/userInfo.vue";
import MyCollect from "../views/MyCollect.vue";
import MyRoom from "../views/MyRoom.vue";
import FoodAndBeverages from "@/views/FoodAndBeverages.vue";
import Luggage from "../views/Luggage.vue";
import BagData from "../views/BagData.vue";
import Coupon from "../views/Coupon.vue";
import RenewRoom from "../views/RenewRoom.vue";
import Success from "../views/Success.vue";



// 配置路由组

const routes = [

    {
        name: 'index',
        path: '/',
        component: login
    },

    {
        name: 'register',
        path: '/register',
        component: register
    },

    {
        name: 'home',
        path: '/home',
        component: home,
        meta: {
            TabbarShow: true
        }
    },
    {
        name: 'call',
        path: '/call',
        component: call,
        meta: {
            TabbarShow: true
        }
    },
    {
        name: 'my',
        path: '/my',
        component: my,
        meta: {
            TabbarShow: true
        }
    },
    {
        name: 'card-box',
        path: '/card-box',
        component: () => import('../views/card-box.vue'),
        meta: {
            TabbarShow: true
        }
    },
    {
        name: 'vip',
        path: '/vip',
        component: vip,
        meta: {
            TabbarShow: true
        }
    },
    {
        name: 'wallet',
        path: '/wallet',
        component: wallet,
        meta: {
            TabbarShow: false
        }
    },

    {
        name: 'RoomList',
        path: '/roomList',
        component: RoomList,
        meta: {
            TabbarShow: false
        }
    },

    {
        name: 'PointsMall',
        path: '/PointsMall',
        component: PointsMall,
        meta: {
            TabbarShow: false
        }
    },

    {
        name: 'ReserveRoom',
        path: '/reserveRoom',
        component: ReserveRoom,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'findpwd',
        path: '/findpwd',
        component: findpwd,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'mylog',
        path: '/mylog',
        component: mylog,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'cashBack',
        path: '/cashBack',
        component: cashBack,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'question',
        path: '/question',
        component: question,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'cashBackLog',
        path: '/cashBackLog',
        component: cashBackLog,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'MyCollect',
        path: '/myCollect',
        component: MyCollect,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'FoodAndBeverages',
        path: '/FoodAndBeverages',
        component: FoodAndBeverages,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'userInfo',
        path: '/userInfo',
        component: userInfo,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'MyRoom',
        path: '/myRoom',
        component: MyRoom,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'Coupon',
        path: '/Coupon',
        component: Coupon,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'Luggage',
        path: '/Luggage',
        component: Luggage,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'BagData',
        path: '/BagData',
        component: BagData,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'RenewRoom',
        path: '/renewRoom',
        component: RenewRoom,
        meta: {
            TabbarShow: false
        }
    },
    {
        name: 'Success',
        path: '/success',
        component: Success,
        meta: {
            TabbarShow: false
        }
    }

]

export function createRouter() {
    return _createRouter({
        history: createWebHistory(),
        routes  // 绑定路由组 和 路由管理者
    })
}
